package gao.wsw.springsecurity.controller;

import gao.wsw.springsecurity.entity.SysRole;
import gao.wsw.springsecurity.service.SysRoleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

//springsecurity角色表(SysRole)表控制层

@RestController
@RequestMapping("sysRole")
public class SysRoleController {
    /**
     * 服务对象
     */
    @Resource
    private SysRoleService sysRoleService;

    //
    //通过主键查询单条数据
    //id 主键
    //   单条数据


    @GetMapping("selectOne/{id}")
    public SysRole selectOne(@PathVariable(name="id") Long id) {
        return this.sysRoleService.queryById(id);
    }

}